{% extends 'backend_layout.html' %}

{% block css %}
    <link rel="stylesheet" href="/static/plugins/kindeditor/themes/default/default.css"/>
    <style>
        .kind-content {
            width: 100%;
            min-height: 500px;
        }
    </style>
{% endblock %}

{% block conent %}
    <ol class="breadcrumb" style="margin-bottom: 0;">
        <li><a href="#">文章管理</a></li>
        <li class="active">添加文章</li>
    </ol>
    <div style="padding: 5px 8px;">
        <form method="POST" action="/backend/add-article.html" novalidate>
            <div class="form-group">
                <label for="{{ form.title.id_for_label }}">标题 <span>{{ form.title.errors.0 }}</span></label>
                {{ form.title }}
            </div>
            <div class="form-group">
                <label for="summary">简介 <span>{{ form.summary.errors.0 }}</span></label>
                {{ form.summary }}
            </div>
            <div class="form-group">
                <label for="content">内容 <span>{{ form.content.errors.0 }}</span></label>
                {{ form.content }}
            </div>
            <div class="form-group">
                <label>类型 <span>{{ form.article_type_id.errors.0 }}</span></label>

                <div>
                    {{ form.article_type_id }}
                </div>

            </div>
            <div class="form-group">
                <label>分类 <span>{{ form.category_id.errors.0 }}</span></label>

                <div>
                    {{ form.category_id }}
                </div>
            </div>
            <div class="form-group">
                <label>标签 <span>{{ form.tags.errors.0 }}</span></label>

                <div>
                    {{ form.tags }}
                </div>
            </div>
            <div class="form-group">
                <input type="submit" class="btn btn-primary" value="保 存">
            </div>
        </form>
    </div>


{% endblock %}

{% block js %}
    <script charset="utf-8" src="/static/plugins/kindeditor/kindeditor-min.js"></script>
    <script charset="utf-8" src="/static/plugins/kindeditor/lang/zh_CN.js"></script>
    <script>
        KindEditor.ready(function (K) {
            var editor = K.create('textarea[name="content"]', {
                resizeType: 1
            });
        });
    </script>
{% endblock %}